---
layout: m1x_soap
title: Credit Balance
---

<h3><a name="storecredit.balance-Module%3ACustomerBalanceAPI"></a>Module: Customer Balance API</h3>


<h4><a name="storecredit.balance-Resource%3Aenterprisecustomerbalance"></a>Resource: enterprise_customerbalance</h4>

<h5><a name="storecredit.balance-Aliases%3Astorecredit"></a>Aliases: storecredit</h5>

<h5><a name="storecredit.balance-Method%3A"></a>Method:</h5>

<ul>
	<li>enterprise_customerbalance.balance (SOAP V1)</li>
	<li>enterpriseCustomerbalanceBalance (SOAP V2)</li>
</ul>


<p>Allows you to retrieve the customer store credit balance amount.</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> string </td>
<td> customerId </td>
<td> Customer ID </td>
</tr>
<tr>
<td> string </td>
<td> websiteId </td>
<td> Website ID </td>
</tr>
</tbody></table>


<p><b>Return:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Description </th>
</tr>
<tr>
<td> string/float </td>
<td> Virtual balance amount </td>
</tr>
</tbody></table>


<p><b>Faults:</b></p>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 100 </td>
<td> Provided data is invalid. </td>
</tr>
<tr>
<td> 101 </td>
<td> No balance found with requested parameters. </td>
</tr>
</tbody></table>



<h4><a name="storecredit.balance-Examples"></a>Examples</h4>

<h5><a name="storecredit.balance-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');
$customerId = 4;
$websiteId = 2;

$balanceAmount = $proxy-&gt;call($sessionId, 'storecredit.balance', array($customerId, $websiteId));</pre>
		</div>
</div></div>

<h5><a name="storecredit.balance-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy-&gt;login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy-&gt;enterpriseCustomerbalanceBalance($sessionId, '4', '2');
var_dump($result);</pre>
		</div>
</div></div>


<h5><a name="storecredit.balance-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey')); 
 
$result = $proxy-&gt;enterpriseCustomerbalanceBalance((object)array('sessionId' =&gt; $sessionId-&gt;result, 'customerId' =&gt; '4', 'websiteId' =&gt; '2'));   
var_dump($result-&gt;result);</pre>
		</div>
</div></div>



